import java.util.Scanner;

public class test {
    public static boolean Func(int k){
        if(k <= 0){
            return false;
        }
        return (k & (k - 1)) == 0;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        System.out.println(Func(k));
    }
}
